package com.cloudm.technician.ui.modules.cloudm_box.upload_level_pic

import com.cloudm.technician.data.model.ImageInfo
import com.cloudm.technician.data.model.UploadTokenInfo
import com.cloudm.technician.ui.base.BasePresenter
import com.cloudm.technician.ui.base.BaseView
import java.io.File

/**
 * 作者: wesley
 * 时间: 2017/12/23
 * 描述: 上传液位照片的协议接口
 */
interface UploadLevelPicContract {

    interface View : BaseView {

        fun buildImageInfoSuccess(list: ArrayList<ImageInfo>)

        fun takePic(position: Int)

        fun showLoadingMsg(position: Int, url: String)

        fun openPicPreviewActivity(position: Int, url: String)

        fun showErrorMsg(errorMsg: String)

        fun updateUiByFlag(flag: Int, position: Int)

        fun showTokenInfoEmpMsg()

        fun loadTokenInfoSuccess(info: UploadTokenInfo, file: File, position: Int)

        fun picUploadFailure()

        fun showUploadPercent(position: Int, percent: Double)

        fun picUploadSuccess(url: String, position: Int)

        fun showUnknowError()

        fun showLevelPicMsg()

        fun showLevelWireMsg()

        fun showUploadDialog()

        fun hideUploadDialog()

        fun showUploadLevelFailureMsg(errorMsg: String)

        fun openChannelListActivity()

        fun openReplaceSuccessActivity()
    }

    interface Presenter : BasePresenter {

        fun buildImageInfo()

        fun buildImageFromLocal(deviceId: Int)

        fun onItemClick(info: ImageInfo, position: Int)

        fun getUploadToken(file: File, position: Int)

        fun uploadFile(info: UploadTokenInfo, file: File, position: Int)

        fun uploadLevelPic(deviceId: Int, recordId: String?, list: ArrayList<ImageInfo>)

        fun updateLocalImage(position: Int, url: String, deviceId: Int, flag: Int)

        fun updateClearImage(deviceId: Int)
    }

}